package zadanie5Done;

class Client extends Thread 
{
	private Resource box;
 	private int id;
 	private int operationsNumber;
 	public Client(Resource c, int id, int operationsNumber) 
	{
  		box = c;
  		this.id = id;
		this.operationsNumber = operationsNumber;
	}
	public void run() 
	{
		for (int i = 1; i < this.operationsNumber; i++) 
		{
			box.put(i);
			System.out.println("Client " + this.id + " put: " + i);
			try 
			{
				sleep((int)(Math.random() * 100));
			} 
			catch (InterruptedException e) {  }
		}
	}
}